<?php

namespace App\Http\Middleware;

use Closure;
use Encore\Admin\Facades\Admin;
use Encore\Admin\Form\Tab;
use Encore\Admin\Layout\Content;
use Encore\Admin\Widgets\InfoBox;

class LoginAdmin
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $user = \Admin::user();
      if(empty($user)){
          echo '请登录';exit;
      }
        return $next($request);
    }
}
